<?php
class model_newagk_adminuser extends gdl_components_basemodel
{

    public function primarykey() {
        return 'id';
    }

    public function tableName() {
        return 'agk_admin_user';
    }
	
	public function getInfoArg($arrg=[],$field)
    {
		if(empty($arrg)) return false;
		return $this->select($arrg, $field)->items;
    }
	
	//检查当前单位下面有没有管理员
	public function checkGroup($units=0)
    {
		if(!$units) return true;
		$groups = $this->selectOne(['unitid'=>$units],'account');
		return empty($groups['account']) ? true : false;
    }
	
}
